'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 5_study_cofigurable_prompt.py
* @Time: 2025/10/24
* @All Rights Reserve By Brtc
'''
import dotenv
from langchain_core.prompts import PromptTemplate
from langchain_core.runnables import ConfigurableField

dotenv.load_dotenv()

prompt = PromptTemplate.from_template("请写一篇关于{subject}主题的冷笑话").configurable_fields(
    template=ConfigurableField(
        id = "llm_prompt_template",
        name = "大模型提示词模板",
        description="提示词模板"
    )
)

#2、使用模板
content = prompt.invoke({
    "subject": "程序员",},
    config={"configurable":{"llm_prompt_template":"{subject}是世界上薪资最高的行业"}}
).to_string()
print(content)
